package com.wp.service.impl;
import com.wp.dao.SysRoleDao;
import com.wp.entity.SysRole;
import com.wp.service.SysRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("rysRoleService")
public class SysRoleServiceImpl implements SysRoleService {

    @Resource
    private SysRoleDao sysRoleDao;

    @Override
    public List<SysRole> findAllSysRole() throws Exception {
        List<SysRole> list = sysRoleDao.queryAllRoleList();
        return list;
    }

    @Override
    public int toAdd(SysRole sysRole) {
        return sysRoleDao.toAdd(sysRole);
    }

    @Override
    public SysRole findById(Integer id) {
        return sysRoleDao.findById(id);
    }

    @Override
    public int del(Integer id) {
        return sysRoleDao.del(id);
    }

    @Override
    public int upd(SysRole sysRole) {
        return sysRoleDao.upd(sysRole);
    }

    @Override
    public SysRole codeExist(String code) {
        return sysRoleDao.codeExist(code);
    }
}
